import React from 'react'
import counterStore from '../store/counterStore'
import {observer} from 'mobx-react-lite'

function counterDemo() {
  return (
    <div>
        <button onClick={()=>counterStore.addCount()}>{counterStore.count}</button>
        <hr />
        <div>{counterStore.list}</div>
        <div>{counterStore.filterList}</div>
        <button onClick={()=>counterStore.changeList()}>change list</button>
    </div>
  )
}

// observer包裹组件，使得mobx仓库中的数据关联组件
export default observer(counterDemo)